<template>
	<view class="container">
		<view class="pass-wrap">
			<view>请输入新密码</view>
			<input type="text"  v-model="userPwd" />
		</view>
		
		<button class="btn-black" type="default" @tap="editAccount">确认</button>
	</view>
</template>
 
<script>
	export default {
		data() {
			return {
				userPwd:''
			};
		},
		onLoad(options) {
			this.id = options.id;
		},
		methods: {
			editAccount() {
				if(!this.userPwd) {
					return uni.showToast({
						title:'请填写新密码',
						icon:'none'
					}) 
				}
				let { id, userPwd } = this;
				this.$u.api._editAccount({id,userPwd:userPwd}).then(res => {
					uni.showToast({
						title:'重置成功'
					})
					setTimeout(() => {
						uni.navigateBack();
					},888)
				});
			}
		}
	}
</script>

<style lang="scss">
	
	page {
		background-color: RGBA(245, 245, 245, 1);
	}
	
	.container {
		padding: 20rpx;
	}
	.pass-wrap {
		border-radius: 16rpx;
		background-color: #FFFFFF;
		padding: 30rpx;
		height: 360rpx;
		font-size: 32rpx;
		color: rgba(36, 47, 68, 1);
		
		input {
			margin-top: 50rpx;
			border: 1rpx solid #eee;
			border-radius: 10rpx;
			height: 90rpx;
			text-align: center;
			letter-spacing: 10rpx;
		}
	}
</style>
